package com.jianggy.simplefactory;

/**
 * @author jianggy
 * @time 2018年9月5日 下午10:37:53
 * @description
 */
public class App {
	public static void main(String[] args) {
		//字符串方式
		DBConnection connection;
		connection = ConnectionFactory.getConnection("mysql");
		connection.connectionInfo();
		connection = ConnectionFactory.getConnection("oracle");
		connection.connectionInfo();
		
		//反射方式
		connection = ConnectionFactory1.getInstance(MysqlConnection.class);
		connection.connectionInfo();
		connection = ConnectionFactory1.getInstance(OracleConnection.class);
		connection.connectionInfo();
		
		
	}
}
